package priv.ljh.operate.mapper;

import org.apache.ibatis.annotations.*;
import priv.ljh.operate.entity.Order;

import java.util.Date;
import java.util.List;

/**
 * @author ：Yshuaong
 * @date ：Created in 2021/6/21 14:14
 * @description：
 * @modified By：
 * @version: $
 */
public interface OrderMapper {
    @Select("select * from orders where uid=#{uid}")
    List<Order> getAllOrder(@Param("uid") int uid);
    @Insert("insert into orders(title,number,img_url,sell_price,flag,add_time,uid) value (#{title},#{number},#{img_url},#{sell_price},#{flag},#{add_time},#{uid})")
    int insertOrder(@Param("title") String title,
                     @Param("number") int number,
                    @Param("img_url") String img_url, @Param("sell_price") String sell_price,
                    @Param("flag") int flag,
                    @Param("add_time") Date add_time,
                    @Param("uid") int uid);
    @Delete("delete from orders where oid=${oid}")
    int deleteOrder(@Param("oid") int oid);
}
